-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented no_std
support (with/without alloc
)
#27
Conversation
…e on `std` and `alloc`, and updated `use` statements accordingly.
…c` feature gates elsewhere. This also included reorganizing the `any` module tests a bit to reduce the number of feature gates needed.
…n use alloc` statement gated by the "alloc" feature. This completes the implementation of `no_std` support.
…derive crate in the test matrix.
…tests with different feature sets.
…" feature on Rust versions before the type was moved from `std` to `core`.
@the10thWiz you may want to take a peak at this; Rocket obviously doesn't need |
…ule and then importing from it instead of `std` or `alloc`.
…`alloc` types whenever possible
@the10thWiz simplified the implementation quite a bit in #28, and the changes have been pulled into this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty great to me. I just have one suggestion.
As pointed out by @the10thWiz, this dependency was not necessary and removing it adds flexibility. Co-authored-by: Matthew Pomes <matthew.pomes@pm.me>
This PR adds support for using the
transient
crate inno_std
environments, with or withoutalloc
, through the addition of new "std" and "alloc" crate features. This PR also includes CI updates that run the tests with various feature sets to ensure everything works regardless of the chosen crate features.To enable
no_std
mode, disable default features using--no-default-features
(ordefault-features = false
in Cargo.toml). Almost all functionality of thetransient
crate will still be available, except for:downcast
/downcast_unchecked
methods on thedyn Any
trait object (which accepts/returns aBox
)Transient::erase
convenience method (which accepts/returns aBox
)Transient
impls for non-core
types (particularlyBox
,Vec
,String
, andHashMap
)To enable
no_std
mode withalloc
support, disable default features and enable the "alloc" feature using--no-default-features --features alloc
(ordefault-features = false, features = ["alloc"]
in Cargo.toml). This restores all of the functionality listed above except for theTransient
impls for several types that are available in neithercore
noralloc
.Resolves #25